/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.client.websockets.socket;

import com.playground.client.websockets.application.PlaygroundApplication;
import com.playground.core.entity.LoggedPlayer;
import com.playground.core.entity.Player;
import com.playground.core.entity.Room;
import com.sun.grizzly.websockets.DefaultWebSocket;
import com.sun.grizzly.websockets.ProtocolHandler;
import com.sun.grizzly.websockets.WebSocketListener;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Tiago Peres
 */
public class PlayerSocket extends DefaultWebSocket {
    private LoggedPlayer player;
    
    public PlayerSocket(ProtocolHandler arg0, WebSocketListener[] arg1){
        super(arg0, arg1);
    }

    // getters and setters
    
    public LoggedPlayer getPlayer() {
        return player;
    }

    public void setPlayer(LoggedPlayer player) {
        this.player = player;
    }
    
    @Override
    public void onMessage(String text){
        Logger.getLogger(PlayerSocket.class.getName()).log(Level.INFO, "MESSAGE RECEIVED AT SOCKET: {0}", text);
        super.onMessage(text);
    }
    
}
